package com.jader.fragment;
import com.jader.activities.DingZhi1;
import com.zlp.jader.R;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;

public class DingZhiFragment extends Fragment implements OnClickListener {
	private View view;
	ImageView fliteriImageView, seacheriImageView;
	ImageView imageView1, imageView2, imageView3, imageView4, imageView5,
			imageView6, imageView7, imageView8;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		view = inflater.inflate(R.layout.activity_work, null);
		inintview();
		return view;

	}

	private void inintview() {
		imageView1 = (ImageView) view.findViewById(R.id.ding_image1);
		imageView2 = (ImageView) view.findViewById(R.id.ding_image2);
		imageView3 = (ImageView) view.findViewById(R.id.ding_image3);
		imageView4 = (ImageView) view.findViewById(R.id.ding_image4);
		imageView5 = (ImageView) view.findViewById(R.id.ding_image5);
		imageView6 = (ImageView) view.findViewById(R.id.ding_image6);
		imageView7 = (ImageView) view.findViewById(R.id.ding_image7);
		imageView8 = (ImageView) view.findViewById(R.id.ding_image8);
		imageView1.setOnClickListener(this);
		imageView2.setOnClickListener(this);
		imageView3.setOnClickListener(this);
		imageView4.setOnClickListener(this);
		imageView5.setOnClickListener(this);
		imageView6.setOnClickListener(this);
		imageView7.setOnClickListener(this);
		imageView8.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		Intent intent = new Intent(getActivity(), DingZhi1.class);
		// 监听所有的单击事件
		switch (v.getId()) {

		case R.id.ding_image1:
			intent.putExtra("url", "http://m.zhuoyixuan.com/cat_list.php?attr=5");
			break;
		case R.id.ding_image2:
			intent.putExtra("url", "http://m.zhuoyixuan.com/cat_list.php?attr=2");
			break;
		case R.id.ding_image3:
			intent.putExtra("url", "http://m.zhuoyixuan.com/cat_list.php?attr=9");
			break;
		case R.id.ding_image4:
			intent.putExtra("url", "http://m.zhuoyixuan.com/cat_list.php?attr=8");
			break;
		case R.id.ding_image5:
			intent.putExtra("url", "http://m.zhuoyixuan.com/cat_list.php?attr=7");
			break;
		case R.id.ding_image6:
			intent.putExtra("url", "http://m.zhuoyixuan.com/cat_list.php?attr=6");
			break;
		case R.id.ding_image7:
			intent.putExtra("url", "http://m.zhuoyixuan.com/cat_list.php?attr=15");
			break;
		case R.id.ding_image8:
			intent.putExtra("url", "http://m.zhuoyixuan.com/cat_list.php?c_id=5");
			break;
		default:
			break;
		}
		startActivity(intent);
	}

}
